package com.seleniti.enpareja.controller.ui.view;

import java.util.Date;
import java.util.List;
import java.util.Set;

import org.ioc.commons.flowcontrol.actioncontroller.IsExternalAction;
import org.ioc.commons.flowcontrol.eventbus.IsEvent;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.ui.HasEnabled;
import org.ioc.commons.ui.HasLoader;
import org.ioc.commons.ui.HasText;
import org.ioc.commons.ui.HasValue;
import org.ioc.commons.ui.HasVisibility;
import org.ioc.commons.ui.IsViewPresenter;
import org.ioc.commons.ui.features.HasBoards;
import org.ioc.commons.ui.features.IsBoard;
import org.ioc.commons.ui.features.IsHelpTip;

import com.seleniti.enpareja.controller.common.domain.LoggedUserInfo;
import com.seleniti.enpareja.controller.model.integration.database.domain.CoupleType;
import com.seleniti.enpareja.controller.model.integration.database.domain.HomeTask;
import com.seleniti.enpareja.controller.ui.view.HomeTasksView.Board;

public interface HomeTasksView extends EnParejaView<HomeTasksView.Event, HomeTasksView.Operation, HomeTasksView.Action>,
		HasLoader, HasEnabled, HasBoards<Board> {

	public enum Board implements IsBoard {
		TASKS_LIST, FORM, BASIC_TASKS_LIST, SCHEDULE_FORM;
	}

	@interface Fires {
		HomeTasksView.Event[] value();
	}

	@interface Invokes {
		HomeTasksView.Action[] value();
	}

	@interface Performs {
		HomeTasksView.Operation[] value();
	}

	public enum Event implements IsEvent {
	}

	public enum Operation implements IsOperation {
		GettingData, Saving, Scheduling
	}

	public enum Action implements IsExternalAction {
		TaskDone, SnoozeTask
	}

	public interface Presenter extends IsViewPresenter {

		void onSwitchElementFromList(HomeTask value);

		void onAddNewElement();

		void onActionModeChanged();

		void onSelectionChanged();

		void onMarkSelectedAsMadeByMember1();

		void onMarkSelectedAsMadeByMember2();

		void onMarkSelectedAsMadeByBoth();

		void onModifyElement(HomeTask element);

		void onDoneOrPendingButtonToggled();

		void onRefreshData();

		void onModifyButtonToggled(boolean enabled);

		void onAddSelectedBasicElements();

		void onCancelAddingSelectedBasicElements();

		void onShowBasics();

		void onHideScheduleSuggestion();

		void onScheduleSuggestion();

		void onScheduleSuggestedForMember1();

		void onScheduleSuggestedForMember2();

		void onScheduleSuggestedForBoth();

		void onHideScheduleForm();
	}

	public enum ActionMode {
		SWITCH_LIST, DELETE_ELEMENT, MODIFY_ELEMENT;
	}

	public enum HelpTips implements IsHelpTip {
		ADD_TASKS, BASIC_TASKS, SWITCH_TASKS, FILTER_PENDING, MODIFY_AND_DELETE, SCHEDULE_TASKS, SEE_TIPS_AGAIN;		
	}

	void setActionMode(ActionMode mode);

	List<HomeTask> homeTasksList();

	void addNewElement();

	ActionMode getActionMode();

	Set<HomeTask> getSelection();

	void showTaskDoneSettings(HomeTask settingsForThis, boolean changeDate);

	HasText member1();

	HasText member2();

	void markSelectedAsMadeByMember1();

	void markSelectedAsMadeByMember2();

	void markSelectedAsMadeByBoth();

	void hideTaskDoneSettings();

	HomeTask getSettingsForThis();

	HasValue<Date> lastTime();

	void modifyElement(HomeTask element);

	HasValue<Boolean> onlyPendingFilter();

	HasValue<Integer> pendingCounter();

	void switchElementFromList(HomeTask value);

	void scrollToElement(int idx);

	HasValue<CoupleType> coupleType();

	Set<String> selectedBasicTasks();

	List<String> basicTasks();

	void showBasics();

	HasValue<LoggedUserInfo> loggedUserInfo();

	HasText scheduleSuggestionText();

	HasVisibility scheduleSuggestionVisibility();

	HasEnabled scheduleSuggestionEnabled();

	void hideScheduleForm();

	HasValue<Date> scheduleDate();

	HasValue<Date> scheduleTime();

}
